package com.caregiver.watch.business.care.model.vo;

import com.caregiver.watch.business.care.enums.PackageTypeEnum;
import com.caregiver.watch.business.care.enums.PackageUnitEnum;
import com.caregiver.watch.business.care.model.po.PackageInfo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.math.BigDecimal;

/**
 * @Description: 健康预警套餐
 * @Author 疆戟
 * @Date 2025/10/12 19:04
 * @Version 1.0
 */
@Data
@Schema(description = "健康预警套餐")
public class HealthAlertPackageVo {

    @Schema(description = "套餐ID")
    private Long packageId;

    @Schema(description = "套餐名称")
    private String packageName;

    @Schema(description = "套餐类型")
    private PackageTypeEnum packageType;

    @Schema(description = "支持的设备数量")
    private Integer supportDeviceNum;

    @Schema(description = "套餐价格")
    private BigDecimal packagePrice;

    @Schema(description = "套餐值")
    private Integer packageValue;

    @Schema(description = "套餐单位 COUNT 次 DAY 天 MONTH 月 YEAR 年")
    private PackageUnitEnum packageUnit;

    public static HealthAlertPackageVo build(PackageInfo packageInfo) {
        HealthAlertPackageVo vo = new HealthAlertPackageVo();
        vo.packageId = packageInfo.getId();
        vo.packageName = packageInfo.getPackageName();
        vo.packageType = packageInfo.getPackageType();
        vo.supportDeviceNum = packageInfo.getSupportDeviceNum();
        vo.packagePrice = packageInfo.getPackagePrice();
        vo.packageValue = packageInfo.getPackageValue();
        vo.packageUnit = packageInfo.getPackageUnit();
        return vo;
    }
}
